<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><{$site_title}>管理中心</title>
<{include file="js.html"}>
<{include file="kindeditor.html"}>
<link type="text/css" rel="stylesheet" href="css/validator.css"></link>
<script src="js/formValidator.js" type="text/javascript"></script>
<script src="js/formValidatorRegex.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
    //多选
    $(".role").click(function() {  
        xieru();
    });  

  //全选
  $(".all").click(function(){  
      var val=$(this).val();
      if(val=='1'){
         $("input:[type=checkbox]").attr('checked',true);
         xieru();
      }else{
        $("input:[type=checkbox]").attr('checked',false);
        $('input:[name=user_id]').val('');
      }
  }); 

  //选择用户
  function xieru(){
    var r_id = "";  
    $("input[name=user]").each(function() {  
        if ($(this).is(":checked")) {  
            r_id += $(this).val()+",";
        }  
    });  
    $('input:[name=user_id]').val(r_id);
  }


  $("#myForm").submit(function(){
    if($('input:[name=user_id]').val()==''){
      alert('请选择用户哦');
      return false;
    }
    return queding('是否保存设置？',".subCheck");
  })

})
</script>
</head>

<body>
<div class="box">
<div style="background:url(images/mainbj.jpg) repeat-x; line-height:31px; height:31px;">
<table width="262" height="31" border="0" cellpadding="0" cellspacing="0">
<tr><td width="41" align="center">
<img src="images/biao1.jpg" /></td>
<td width="221"><strong>当前位置</strong>：站内信 &gt; 添加消息</td>
</tr></table>
</div>

<form action="" method="post" name="myForm" id="myForm" enctype='multipart/form-data'>
<table class="lefttab" cellpadding="0" cellspacing="0">
<tr><td colspan="3"><div style="height:26px; text-align:left; line-height:26px; background:url(images/xbj1.jpg) repeat-x; border:1px solid #e9f5fa;font-weight:bold;">&nbsp;&nbsp;添加消息</div>
</td></tr>
<tr>
  <td width="100" align="right"><font color="#e47c02">*</font> <strong>消息标题</strong>：</td>
  <td width="310" align="left">&nbsp;<input type="text" name="title"  size="20" class="subCheck" value="<{$row.title}>" /></td>
</tr>
<tr>
  <td align="right"><font color="#e47c02">*</font> <strong>消息内容 </strong>：</td>
  <td align="left">&nbsp;<textarea name="intro" class="subCheck" rows="5" cols="40" ><{$row.intro}></textarea> </td>
</tr>

<tr>
  <td align="right"><font color="#e47c02">*</font> <strong>选择用户</strong>：</td>
  <td width="873" align="left">
  <{foreach item=loop from=$user}>
      <input type="checkbox" class="role" value="<{$loop.id}>" name="user"/><{$loop.account}>&nbsp;&nbsp;
  <{/foreach}>
  </td>
</tr>
 <input type="hidden" name="user_id" value="<{$user_id}>"/>

<tr>
  <td align="right"><font color="#e47c02">*</font> <strong>快捷操作</strong>：</td>
  <td width="873" align="left">

    <input type="radio" class="all" name="all" value="1" />全选&nbsp;
    <input type="radio" class="all" name="all" value="2" />取消全选&nbsp;

  </td>
</tr>

<tr><td height="50px" colspan="2">
	<p>&nbsp;</p>
    <p align="left" style="margin-left:100px;">
      &nbsp;&nbsp;<input type="submit" name="submit" value="保存" class="inp"/>
      </p>    <p>&nbsp;</p></td>
  </tr>
</table>
</form>

</div>
</body>
</html>